#include "junix.h"
#include <boost/functional.hpp>
using namespace std;

struct A{
	A(int i):n(i){ }
	int n;
	friend ostream& operator<< (ostream& os, const A& a)
	{
		os<<a.n;
		return os;
	}
};

bool gt10(const A& a)
{
	return a.n>10;
}

int main(int argc, char **argv)
{
	srand(30);
	vector<A>  va;
	for(int i=0;i<30;i++)
		va.push_back( A(rand()%30));

	ostream_iterator<A> oit(cout," ");
	remove_copy_if( va.begin(), va.end(), 
			oit, gt10);
	cout<<endl;


	remove_copy_if( va.begin(), va.end(), 
			oit, boost::not1(gt10));
	cout<<endl;

}
